package com.example.foo.order.service;

import com.alipay.api.AlipayApiException;
import com.example.foo.order.model.Order;
import com.example.foo.weixin.domain.params.TransactionDoResp;
import org.springframework.stereotype.Service;

import javax.servlet.http.HttpServletRequest;

public interface TransactionService {

    /**
     * 交易业务 - 执行
     */
    TransactionDoResp transactionDo(Order order, HttpServletRequest request);

    /**
     * 支付宝支付接口
     * @param order
     * @return
     * @throws AlipayApiException
     */
    String aliPay(Order order) throws AlipayApiException;

    /**
     * 支付宝APP支付接口
     * @param order
     * @return
     * @throws AlipayApiException
     */
    String aliAppPay(Order order) throws AlipayApiException;

    /**
     * 交易H5业务 - 执行
     */
    String transactionDoH5(Order order,String redirectUrl, HttpServletRequest request);

    String payBack(String notifyData);

    String aliPayBack(HttpServletRequest request);

}
